home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1991: Code Warrior / bincue / Code Warrior.bin / Tools & Apps (Moof!) / Localization Tools / MPW Localization Tool / Localization / RunLoop < prev   
Encoding:
Text File  |  1990-08-23  |  25.7 KB  |  597 lines  |  [TEXT/MPS ]

  1. #################################   FILE HEADER   #################################
  2. #    © Apple Computer, 1985-1990
  3. #
  4. #  FILE:        RunLoop
  5. #  AUTHORS:    Cindy Roberts            Apple International Software Support 
  6. #                        Peter Potrebic(?)    Apple Product Development
  7. #                        Dave McGary                Apple International Software Support 
  8. #  CREATED:    ?/??/88?
  9. #  PURPOSE:    Automated localization of revised Macintosh software.
  10. #  DESCR.:    This script uses 3 files to perform the localization.  
  11. #                        The 3 files are derezed from 3 versions of the same application.
  12. #                        The 3 versions are: an old US (non-localized) version; a new US 
  13. #                        (non-localized) version; and an old localized version.
  14. #                        The base names of the 3 files are passed to this script in 
  15. #                        the MPW script variables OldUS OldLoc and NewUS.  The script 
  16. #                        appends “.r” to the script variable and opens the file.  
  17. #                        All changes are made to the {NewUS}.r file.  
  18. #
  19. ################################   REVISION HISTORY   #############################
  20. #
  21. #        July 30                 made STR# go to the beginning of NewUS after each string list
  22. #        July 30                 found a better way to search for the number of the STR#'s
  23. #        Oct 10                  fixed problem with UserItems in DITLs
  24. #        Oct 13                  fixed problem with empty strings in STR# resources
  25. #
  26. #        Mar 11, 1988         added ability to compare MENU, CNTL resources; 
  27. #                                        now compares box sizes instead of copying them automatically                
  28. #   March 11    Cindy    tiles windows so you can see all of them at one time; 
  29. #                                        at end it stacks them
  30. #        March 18                made aliases so program wouldn't be sooooo confusing!
  31. #        March 18                compared all box sizes before copying them over
  32. #        March 24                added ability to compare TEXT, WIND resources
  33. #        March 29                fixed problem with UserItems in DITLs (skipped too far in 
  34. #                                        one of the files)
  35. #        March 29                will copy now even if the attributes of the resource are 
  36. #                                        different in the files
  37. #        March 29                fixed problem with negative resource numbers
  38. #
  39. #        April 25                fixed problem with finding matching resource numbers when 
  40. #                                        number of digits differ
  41. #        May 2                        fixed problem with single digit DITL resource numbers
  42. #                                        fixed problem if the number if items in DITL,MENU or STR# 
  43. #                                        don't match in OldUS and OldLoc
  44. #        1/26/90   ddm        Added the file header, cleaned up the revision  notes, 
  45. #                                        changed font, added strategy comments below.
  46. #        1/29/90        ddm        Added MPW “variables” (constants) Success and Failure to
  47. #                                        make the code easier to follow.
  48. #        1/30/90        ddm        Rewrote all of the loops to key off of NewUS so that
  49. #                                        new resources can be reported in the new Log file!
  50. #                                        Added a mark for every major loop.
  51. #        1/31/90        ddm        Added code to create and send entries to said log file.
  52. #        2/1/90        ddm        Debugged new code log code and modifications to allow
  53. #                                        using NewUS as the key file.
  54. #                                        Fixed a bug which prevented localization of WINDow names.
  55. #        2/2/90        ddm        Standardized capitalization of NewUS, OldUS and OldLoc.
  56. #                                        Changed §!1:§!2 (finds 2 characters) to §!1:§!1 (finds
  57. #                                        one character) in .... loop when verifying that the next 
  58. #                                        character is a comma.  Removed comments (some mine, some
  59. #                                        not) about fears of possible problems which were unfounded.
  60. #                                        
  61. #                                        
  62. #
  63. #     Dave's notes (from here 'till the code starts):    
  64. #
  65. #     We need to consider the following conditions for any one resource:
  66. #         1)    All files contain the resource
  67. #         2)    The resource is new (in NewUS, not in OldUS)
  68. #         3)    The resource was removed (in OldUS, not in NewUS)
  69. #    
  70. #     Note: I am assuming that any resource in OldUS is in OldLoc.
  71. #     I realize this may not always be true, and I should allow for it.
  72. #     (an example of this problem is the removal of the 'lctb' resource
  73. #     in the Japanese localization of HyperCard)
  74. #
  75. #     Cindy's script allows for conditions 1 & 2 only.  In case of condition 2,
  76. #     Cindy's code does nothing.  I am adding code today (1/26/90) to log these
  77. #     failures (condition #2) to a new (text format) log file.
  78. #
  79. #     What can happen to a resource during localization?
  80. #         the resource is used unchanged
  81. #         the resource is localized
  82. #         the resource is removed for localization
  83. #         the resource is added for localization
  84. #
  85. #     A word of caution about the confusing, convoluded code at the start of 
  86. #     each search for a new resource.  The code looks something like this:
  87. #
  88. #             find /∂'ALRT∂'/ "{OldLoc}.r"    
  89. #             break if {status} == {Failure}
  90. #             find {id.num} "{OldLoc}.r"
  91. #             find /∂'ALRT∂' ∂(`catenate "{OldLoc}.r".§`[,)]+/ "{NewUS}.r"
  92. #
  93. #     The problems which make this necessary (a single find should be able
  94. #     to match the string found by the first 3 lines) revolve around the single
  95. #     quote character (') used to denote the type of a resource in a rez file.
  96. #     This character has special meaning in MPW scripts and in regular 
  97. #     expresions.  The unsurmountable problems involve regular expresions 
  98. #     (you can't select text with 's in it and then do a find of §; you get
  99. #     illegal expression errors, because the 's are treated special).
  100. #
  101. #     There is a simple solution: replace the ' character before the searches
  102. #     are performed.  This can be done only if the character you are going
  103. #     to replace the 's with is not contained in the file when you start 
  104. #     (this guarentees that the reverse of the substitution will work 
  105. #        correctly).  This would require a very simple tool to be written 
  106. #     before it would work reliably.  The tool would have to select the
  107. #     next character to search for, and would have to set the status to 2
  108. #     to stop the process when it gets to the last possible character.
  109. #
  110. #
  111.  
  112. if `Exists "{localization}"`                            #    if the localization directory exists,
  113.     set Log "{localization}LocalizationLog" #        put the log file there
  114. else                                                                            # otherwise
  115.     set Log "{mpw}LocalizationLog"                    #     put the log file in the MPW folder
  116. end                                                                                # end {of if}
  117.  
  118. echo RunLoop -- version 2/1/90 > "{Log}"
  119. echo RunLoop -- starting `date` >> "{Log}"
  120. echo  "File {NewUS}.r"  >> "{Log}"
  121. echo  "The following resources should be localized:"  >> "{Log}"
  122.  
  123. set Success 0                                                            #
  124. set Failure 2                                                            #
  125. set id.num /([-])*([0-9])+/                                #
  126. set box /∂{/:/∂}/                                                    #
  127.                                                                                     #
  128. set string Δ/[ ∂t∂n]∂"≈∂"/!2:Δ/∂"[ ∂t∂n]*[;},∂/][ ∂t∂n;,]+[∂/}rn]/
  129.  
  130. open "{NewUS}.r"                                                    #
  131. open "{OldUS}.r"                                                    #
  132. open "{OldLoc}.r"                                                    #
  133. open "{log}"
  134.  
  135. #tilewindows                                                            # set up the windows for action.
  136. SizeWindow 500 100 "{NewUS}.r"
  137. SizeWindow 500 100 "{OldUS}.r"
  138. SizeWindow 500 100 "{OldLoc}.r"
  139. SizeWindow 500 100 "{Log}"
  140.  
  141. MoveWindow   3   0 "{NewUS}.r"
  142. MoveWindow   3  85 "{OldUS}.r"
  143. MoveWindow   3 170 "{OldLoc}.r"
  144. MoveWindow   3 255 "{Log}"
  145.  
  146.  
  147. find • "{NewUS}.r"                                        # go to beginning of file
  148. find • "{OldLoc}.r"                                        # go to beginning of file
  149. find • "{OldUS}.r"                                        # go to beginning of file
  150. #
  151. #
  152. #
  153. Loop
  154.     find /∂'ALRT∂'/ "{NewUS}.r"                    # Find next ALRT rsrc in NewUS
  155.     break if {status} == {Failure}            # If not found, we are done.
  156.     find {id.num} "{NewUS}.r"                        # get ID number of the ALRT
  157.     set Number `catenate "{NewUS}.r".§`    # Save the resource number for use later
  158.                                                                             # Find matching rsrc in OldLoc
  159.     find /∂'ALRT∂' ∂({Number}[,)]+/ "{OldLoc}.r"
  160.                                                                             #  Find matching rsrc in OldUS
  161.     find /∂'ALRT∂' ∂({Number}[,)]+/ "{OldUS}.r"
  162.     if {status} == {Success}                        # if found, I can localize it!
  163.         find /∂{/ "{NewUS}.r"                            #    find open curly bracket in NewUS
  164.         find /∂{/ "{OldLoc}.r"                        #    find open curly bracket in OldLoc
  165.         find /∂{/ "{OldUS}.r"                            #    find open curly bracket in OldUS
  166.         find {box} "{NewUS}.r"                        # find the box coordinates in NewUS
  167.         find {box} "{OldUS}.r"                        # find the box coordinates in OldUS
  168.                                                                             # compare the old & new US boxes
  169.         compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  170.         if {status} == {Success}                    # If they are equal
  171.             copy {box} "{OldLoc}.r"                 # then cut and paste box size
  172.             paste § "{NewUS}.r"                            #      from OldLoc to NewUS
  173.         else                                                             # else (the rectangle coordinates changed)
  174. #            find {box} "{OldLoc}.r"                 # find the box coordinates in OldLoc
  175.                                                                             # Log the box change!
  176.             echo "***    Rectangle change — ∂'ALRT∂' {Number}" >> "{Log}"
  177.         end                                                                #
  178.     else                                                                 # else (new ALRT!)
  179.                                                                             # Log the new resource!
  180.         echo "***    New resource — ∂'ALRT∂' {Number}" >> "{Log}"
  181.     end                                                                    #
  182.     find • "{OldLoc}.r"                                    # go to beginning of file
  183.     find • "{OldUS}.r"                                    # go to beginning of file
  184. End                                                                        # End of the loop, on to the next resource type
  185. find • "{NewUS}.r"                                        # go to beginning of file
  186. #
  187. #
  188. Loop
  189.     find /∂'CNTL∂'/ "{NewUS}.r"                    # find the next CNTL resource
  190.     break if {status} == {Failure}            # exit this loop if there are no CNTLs in NewUS
  191.     find {id.num} "{NewUS}.r"                        # find ID number of the CNTL
  192.     set Number `catenate "{NewUS}.r".§`    # Save the resource number for use later
  193.                                                                             # Find the same CNTL in OldLoc
  194.     find /∂'CNTL∂' ∂({Number}[,)]+/ "{OldLoc}.r"
  195.                                                                             # Find the same CNTL in OldUS
  196.     find /∂'CNTL∂' ∂({Number}[,)]+/ "{OldUS}.r"
  197.     if {status} == {Success}                        # if found, check the box coordinates
  198.         find {box} "{NewUS}.r"                        # get box coordinates from NewUS
  199.         find {box} "{OldUS}.r"                        # get box coordinates from OldUS
  200.                                                                             # Compare OldUS to NewUS
  201.         compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  202.         if {status} == {Success}                    # If they are equal,
  203.             copy {box} "{OldLoc}.r"                 # then    cut and paste box size
  204.             paste § "{NewUS}.r"                            #                from OldLoc to NewUS
  205.         else                                                             # else the box coordinates changed!
  206. #            find {box} "{OldLoc}.r"                 # find box coordinates in OldLoc
  207.                                                                             # Log the box change!
  208.             echo "***    Rectangle change — ∂'CNTL∂' {Number}" >> "{Log}"
  209.         end                                                             # end (of if)
  210.         find {string} "{NewUS}.r"                    #    Find the name of the control in NewUS
  211.         find {string} "{OldUS}.r"                    #    Find the name of the control in OldUS
  212.                                                                             # Check to see if the name has changed
  213.          compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  214.         if {status} == {Success}                    #    If the strings match!
  215.             find {string} "{OldLoc}.r"            #     then copy and paste the name
  216.                                                                             #                 from OldLoc to NewUS
  217.             catenate "{OldLoc}.r".§ > "{NewUS}.r".§
  218.         else
  219.                                                                             # Log the change!
  220.             echo "***    Name change — ∂'CNTL∂' {Number}" >> "{Log}"
  221.         end                                                                # end (of if strings match)
  222.     else                                                                # New CNTL resource!
  223.                                                                             # Log the change!
  224.         echo "***    New resource — ∂'CNTL∂' {Number}" >> "{Log}"
  225.     end                                                                    # end (of if CNTL found)
  226.     find • "{OldLoc}.r"                                    # go to beginning of OldLoc file
  227.     find • "{OldUS}.r"                                    # go to beginning of OldUS file
  228. End                            #                                            # end of CNTL loop
  229. find • "{NewUS}.r"                                        # go to beginning of NewUS file
  230. #
  231. #
  232. Loop                                                                    #    Start of DITL loop
  233.     find /∂'DITL∂'/ "{NewUS}.r"                    #
  234.     break if {status} == {Failure}            # end of all DITL's
  235.     find {id.num} "{NewUS}.r"                        # find its id number
  236.     set Number `catenate "{NewUS}.r".§`    # Save the resource number for use later
  237.                                                                             #
  238.     find /∂'DITL∂' ∂({Number}[,)]+/ "{OldLoc}.r"
  239.                                                                             #
  240.     find /∂'DITL∂' ∂({Number}[,)]+/ "{OldUS}.r"
  241.     if {status} == {Success}                        # if 
  242.         find /∂// "{NewUS}.r"                         # skip over number of items comment 
  243.         Loop                                                            #
  244.                                                                              # get the item number from NewUS
  245.             find /∂/∂* ∂[/!0:/∂] ∂*∂//¡0 "{NewUS}.r"
  246.             break if {status} == {Failure}  # stop if we run out of items to localize
  247.                                                                             # Save the item number for use later
  248.             set ItemNumber `catenate "{NewUS}.r".§`
  249.                                                                              # look for the item in OldLoc
  250.             find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{OldLoc}.r"
  251.                                                                              # look for the item in NewUS
  252.             find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{OldUS}.r"
  253.             if {status} == {Failure}  # there are more items in new file than in old file
  254.                                                                             # Log the change!
  255.                 echo "***    New item(s) in — ∂'DITL∂' {Number}" >> "{Log}"
  256.                 break
  257.             end
  258.             find {box} "{NewUS}.r"                    #
  259.             find {box} "{OldUS}.r"                    #
  260.             compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  261.             if {status} == {Success}                #
  262.                 copy {box} "{OldLoc}.r"             # cut and paste box size
  263.                 paste § "{NewUS}.r"                        #
  264.             else                             #                            #
  265.                 find {box} "{OldLoc}.r"             #(necessary?)
  266.                                                                             # Log the change!
  267.                 echo "***    Size/location change — ∂'DITL∂' {Number}  item {ItemNumber}" >> "{Log}"
  268.             end                            #                                #
  269.             find {box} "{NewUS}.r"                    #
  270.             find §¡1:§¡4 "{NewUS}.r"                #
  271.                                                                             #
  272.             if `catenate "{NewUS}.r".§` == "Item"
  273.                 find /∂{/:/∂}/ "{NewUS}.r"            #
  274.                 find /∂}/ "{NewUS}.r"                    #
  275.                 find §Δ:§!1 "{NewUS}.r"                # finds next char after string 
  276.                                                                             # break if UserItem is last string in list
  277.                 break if `catenate "{NewUS}.r".§` ≠ ","
  278.                 find /∂{/:/∂}/ "{OldLoc}.r"       # if user item then skip to next string (string?)
  279.                 find /∂{/:/∂}/ "{OldUS}.r"            #
  280.             else                                                        #
  281.                 find /∂{/:/∂}/ "{NewUS}.r"       # find the string
  282.                 find /∂{/:/∂}/ "{OldUS}.r"            #
  283.                 compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  284.                 if {status} == {Success}            #
  285.                     copy /∂{/:/∂}/ "{OldLoc}.r"     # cut and paste text or icon info
  286.                     paste § "{NewUS}.r"                    #
  287.                 else                                                     #
  288. #                    find /∂{/:/∂}/ "{OldLoc}.r"     #
  289.                                                                             # Log the change!
  290.                     echo "***    Item change (text, name, etc) — ∂'DITL∂' {Number}  item {ItemNumber}" >> "{Log}"
  291.                 end        # need to check to see if character after selection in old US is comma--tests for end of this DITL
  292.                 find §Δ:§!1 "{NewUS}.r"                #
  293.                                                                             # Standard exit...
  294.                 break if `catenate "{NewUS}.r".§` ≠ ","
  295.                 find §Δ:§!1 "{OldUS}.r"                #
  296.                 if `catenate "{OldUS}.r".§` ≠ ","
  297.                                                                             # Log the change!
  298.                     echo "***    New item(s) in — ∂'DITL∂' {Number}  after item {ItemNumber}" >> "{Log}"
  299.                     break
  300.                 end
  301.             end                                                            # end of else
  302.         end                                                                # end of loop
  303.     else                                                                 # else (new DITL!)
  304.                                                                             # Log the new resource!
  305.         echo "***    New resource — ∂'DITL∂' {Number}" >> "{Log}"
  306.     end                                                                    # end of status equal to zero test
  307.     find • "{OldLoc}.r"                                    #
  308.     find • "{OldUS}.r"                                    # go to beginning of file
  309. End                                                                        #
  310. find • "{NewUS}.r"                                        #
  311. #
  312. #
  313. Loop
  314.     find /∂'DLOG∂'/ "{NewUS}.r"                    # find the next DLOG resource
  315.     break if {status} == {Failure}            #
  316.     find {id.num} "{NewUS}.r"                        # find its id number
  317.     set Number `catenate "{NewUS}.r".§`    # Save the resource number for use later
  318.                                                                             #
  319.     find /∂'DLOG∂' ∂({Number}[,)]+/ "{OldLoc}.r"
  320.                                                                             #
  321.     find /∂'DLOG∂' ∂({Number}[,)]+/ "{OldUS}.r"
  322.     if {status} == {Success}                        # if 0 I found it
  323.         find /∂{/ "{NewUS}.r"                            #
  324.         find /∂{/ "{OldUS}.r"                            #
  325.         find /∂{/ "{OldLoc}.r"                        #
  326.         find {box} "{NewUS}.r"                        #
  327.         find {box} "{OldUS}.r"                        #
  328.                                                                             #
  329.         compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  330.         if {status} == {Success}                    #
  331.             copy {box} "{OldLoc}.r"                 # cut and paste box size
  332.             paste § "{NewUS}.r"                            #
  333.         else                                                             #
  334. #            find {box} "{OldLoc}.r"                 #
  335.             echo "***    Size/location change — ∂'DLOG∂' {Number}" >> "{Log}"
  336.         end                                                                #
  337.         find /∂"/:/∂"/ "{NewUS}.r"                    # find info in quotes
  338.                                                                             # is info identical?
  339.         find /∂"`catenate "{NewUS}.r".§`∂"/ "{OldUS}.r"
  340.         if {status} == {Success}                    #
  341.             find /∂"/:/∂"/ "{OldLoc}.r"            #
  342.             copy § "{OldLoc}.r"                         # if same, cut and paste info
  343.             paste § "{NewUS}.r"                            #
  344.         else
  345.                                                                             # Log the new resource!
  346.             echo "***    Text change — ∂'DLOG∂' {Number}" >> "{Log}"
  347.         end                                                                #
  348.     else                                                                 # else (new DLOG!)
  349.                                                                             # Log the new resource!
  350.         echo "***    New resource — ∂'DLOG∂' {Number}" >> "{Log}"
  351.     end                                                                    #
  352.     find • "{OldLoc}.r"                                    # go to beginning of file
  353.     find • "{OldUS}.r"                                    #
  354. End                                                                        #
  355. find • "{NewUS}.r"                                        #
  356. #
  357. #
  358. Loop
  359.     find /∂'MENU∂'/ "{NewUS}.r"                                            # find the next MENU resource
  360.     break if {status} == {Failure}                                    # Stop if there are no more in NewUS.
  361.     find {id.num} "{NewUS}.r"                                                # find its id number
  362.     set Number `catenate "{NewUS}.r".§`                            # Save the resource number for use later
  363.     find /∂'MENU∂' ∂({Number}[,)]+/ "{OldLoc}.r"            # Find the same menu resource in OldLoc
  364.     find /∂'MENU∂' ∂({Number}[,)]+/ "{OldUS}.r"            # Find the same menu resource in OldUS
  365.     if {status} == {Success}                                                # if I found a match, continue
  366.         find /[0-9]+/:/∂,∂n∂t∂{/ "{NewUS}.r"                        # Get the entire item (5 pieces, 1 string)
  367.         find /[0-9]+/:/∂,∂n∂t∂{/ "{OldUS}.r"                        # Get the same in OldUS
  368.                                                                                                     # Check to see if the entire menu dude matches
  369.         compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  370.         if {status} == {Success}                                            #
  371.             copy /[0-9]+/:/∂,∂n∂t∂{/ "{OldLoc}.r"                # copy and paste menu name (?????)
  372.             paste § "{NewUS}.r"                                                    #
  373.         else                                                                                    #
  374.             find /[0-9]+/:/∂,∂n∂t∂{/ "{OldLoc}.r"                # sync-up with NewUS (required)
  375.                                                                                                     # Log the change!
  376.             echo "***    Menu name change — ∂'MENU∂' {Number}" >> "{Log}"
  377.         end                                                                                        #
  378.         find /[0-9]+/ "{OldLoc}.r"                                        # get the menu item count
  379.         if "`catenate "{OldLoc}.r".§`" != "0"                    # if it's ≠ 0, proceed.
  380.             Loop                                                                                #
  381.                 find /∂/∂* ∂[/!0:/∂] ∂*∂//¡0 "{OldLoc}.r"    # copy and paste menu items 
  382.                 set ItemNumber `catenate "{OldLoc}.r".§`
  383.                                                                                                     #
  384.                 find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{OldUS}.r"
  385.                                                                                                     #
  386.                 find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{NewUS}.r"
  387.                 find {string} "{OldUS}.r"                                    #
  388.                 find {string} "{NewUS}.r"                                    #
  389.                                                                                                     #
  390.                 compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  391.                 if {status} == {Success}                                    #
  392.                     find {string} "{OldLoc}.r"                             # copy and paste menu item
  393.                     catenate "{OldLoc}.r".§ > "{NewUS}.r".§    #
  394.                 else                                                                             #
  395.                     find {string} "{OldLoc}.r"                            #
  396.                                                                                                     # Log the change!
  397.                     echo "***    Menu item change — ∂'MENU∂' {Number}  item {ItemNumber}" >> "{Log}"
  398.                 end                                                                                #
  399.                 find /∂n/ "{NewUS}.r"                                            #
  400.                 find §:§¡1 "{NewUS}.r"                                        #
  401.                 break if `catenate "{NewUS}.r".§` ≠ ","        # break-out if NewUS is empty
  402.                 find /∂n/ "{OldUS}.r"                                            #
  403.                 find §:§¡1 "{OldUS}.r"                                        #
  404.                 if `catenate "{OldUS}.r".§` ≠ ","                    # if OldUS is empty, NewUS has more
  405.                                                                                                     # Log the change!
  406.                     echo "***    New menu item — ∂'MENU∂' {Number}  item {ItemNumber}" >> "{Log}"
  407.                     break
  408.                 end                                                                                # end (if catenate...
  409.             end                                                                                    # end (if # entries ≠ 0)
  410.         end                                                                                        #
  411.     else                                                                                         # No matching MENU in OldUS!
  412.                                                                                                     # Log the new resource!
  413.         echo "***    New resource — ∂'MENU∂' {Number}" >> "{Log}"
  414.     end                                                                                            #
  415.     find • "{OldLoc}.r"                                                            # go to beginning of file
  416.     find • "{OldUS}.r"                                                            #
  417. End                                                                                                #
  418. find • "{NewUS}.r"                                                                #
  419. #
  420. #
  421. Loop                                                                    #
  422.     find /∂'STR ∂'/ "{NewUS}.r"                    # find the next STR resource    
  423.     break if {status} == {Failure}            #
  424.     find {id.num} "{NewUS}.r"                        # find its id number
  425.     set Number `catenate "{NewUS}.r".§`    # Save the resource number for use later
  426.                                                                             #
  427.     find /∂'STR ∂' ∂({Number}[,)]+/ "{OldLoc}.r"
  428.                                                                             #
  429.     find /∂'STR ∂' ∂({Number}[,)]+/ "{OldUS}.r"
  430.     if {status} == {Success}                        # if same resource found in both NewUS & OldUS
  431.         find /∂{/:/∂}/ "{NewUS}.r"                    #
  432.         find /∂{/:/∂}/ "{OldUS}.r"                    #
  433.                                                                             #
  434.         compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  435.         if {status} == {Success}                    # String remains unchanged
  436.             copy /∂{/:/∂}/ "{OldLoc}.r"             # cut and paste text or icon info
  437.             paste § "{NewUS}.r"                            #
  438.         else                                                            # String has changed
  439. #        find /∂{/:/∂}/ "{OldLoc}.r"                #
  440.                                                                             # Log the change!
  441.             echo "***    Text change — ∂'STR ∂' {Number}" >> "{Log}"
  442.         end                                                                #    
  443.     else                                                                 # else (new STR !)
  444.                                                                             # Log the new resource!
  445.         echo "***    New resource — ∂'STR ∂' {Number}" >> "{Log}"
  446.     end                                                                    # if 0 I found it
  447.     find • "{OldLoc}.r"                                    # go to beginning of file
  448.     find • "{OldUS}.r"                                    #
  449. End                                                                        #
  450. find • "{NewUS}.r"                                        #
  451. #
  452. #
  453. Loop                                                                    # STR# (string-list) loop
  454.     find /∂'STR∂#∂'/ "{NewUS}.r"                    # find the next STR# resource
  455.     break if {status} == {Failure}            # end of all STR#'s
  456.     find {id.num} "{NewUS}.r"                        # find its id number
  457.     set Number `catenate "{NewUS}.r".§`    # Save the resource number for use later
  458.                                                                             #
  459.     find /∂'STR∂#∂' ∂({Number}[,)]+/ "{OldLoc}.r"
  460.                                                                             #
  461.     find /∂'STR∂#∂' ∂({Number}[,)]+/ "{OldUS}.r"
  462.     if {status} == {Success}                        # if matching string-lists are found 
  463.         find /∂/∂* /:/ ∂*∂// "{OldLoc}.r"    #
  464.         find /∂/∂* /:/ ∂*∂// "{OldUS}.r"        #
  465.         find /∂/∂* /:/ ∂*∂// "{NewUS}.r"        #
  466.         Loop                                                            #    String loop (check each string in the list)
  467.                                                                             #
  468.             find /∂/∂* ∂[/!0:/∂] ∂*∂//¡0 "{NewUS}.r"
  469.                                                                             #
  470.             set ItemNumber `catenate "{NewUS}.r".§`
  471.                                                                             # find next item 
  472.                                                                             # ddm- which may not be in this resource
  473.                                                                             # ddm- so we have to check to see if 
  474.                                                                             # ddm- ItemNumber = 1
  475.             find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{OldLoc}.r"
  476.                                                                             #
  477.             find /∂/∂* ∂[{ItemNumber}∂] ∂*∂// "{OldUS}.r"
  478.             if {status} == {Failure}                # 
  479.                                                                             # Log the new string! (empty STR# in OldUS file?)
  480.                 echo "***    New string(s) in — ∂'STR#∂' {Number}" >> "{Log}"
  481.                 break                                                    # Exit the String Loop!
  482.             end                                                            #
  483.             find {string} "{OldUS}.r"                #
  484.             find {string} "{NewUS}.r"                #
  485.             find {string} "{OldLoc}.r"            #
  486.                                                                             #
  487.              compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  488.             if {status} == {Success}                # if text matches in NewUS and OldUS
  489.                                                                             # copy and paste text or icon info
  490.                 catenate "{OldLoc}.r".§ > "{NewUS}.r".§
  491.             else                                                         #
  492.                                                                             # Log the new text!
  493.                 echo "***    New text in — ∂'STR#∂' {Number}  item {ItemNumber}" >> "{Log}"
  494.             end                                                            #
  495.             find §!1:§!1 "{NewUS}.r"                # check next character in NewUS for comma.
  496.                                                                             # if not found, break
  497.             break if `catenate "{NewUS}.r".§` ≠ ","
  498.             find §!1:§!1 "{OldUS}.r"                # check next character in OldUS for comma.
  499.                                                                             # if not found, there is a new string
  500.             if `catenate "{OldUS}.r".§` ≠ ","
  501.                                                                             # Log the new string!
  502.                 echo "***    New string(s) in — ∂'STR#∂' {Number}" >> "{Log}"
  503.                 break                                                    # if not found, break
  504.             end
  505.         end                                                                #
  506.     else                                                                 # else (new STR#!)
  507.                                                                             # Log the new resource!
  508.         echo "***    New resource — ∂'STR#∂' {Number}" >> "{Log}"
  509.     end                                                                    #
  510.     find • "{OldUS}.r"                                    # go to beginning of file
  511.     find • "{OldLoc}.r"                                    # go to beginning of file
  512. End                                                                        #
  513. find • "{NewUS}.r"                                        #
  514. #
  515. #
  516. Loop                                                                    #
  517.     find /∂'TEXT∂'/ "{NewUS}.r"                    # find the next TEXT resource    
  518.     break if {status} == {Failure}            #
  519.     find {id.num} "{NewUS}.r"                        # find its id number
  520.     set Number `catenate "{NewUS}.r".§`    # Save the resource number for use later
  521.                                                                             #
  522.     find /∂'TEXT∂' ∂({Number}[,)]+/ "{OldLoc}.r"
  523.                                                                             #
  524.     find /∂'TEXT∂' ∂({Number}[,)]+/ "{OldUS}.r"
  525.     if {status} == {Success}                        # if 0 I found it
  526.         find {string} "{NewUS}.r"                    #
  527.         find {string} "{OldUS}.r"                    #
  528.                                                                             #
  529.         compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  530.         if {status} == {Success}                    #
  531.             copy {string} "{OldLoc}.r"             # cut and paste text or icon info
  532.             paste § "{NewUS}.r"                            #
  533.         else                                                            #
  534. #            find {string} "{OldLoc}.r"            #
  535.                                                                             # Log the changes!
  536.             echo "***    Text changes detected — ∂'TEXT∂' {Number}" >> "{Log}"
  537.         end                                                                #
  538.     else                                                                 # else (new TEXT!)
  539.                                                                             # Log the new resource!
  540.         echo "***    New resource — ∂'TEXT∂' {Number}" >> "{Log}"
  541.     end                                                                    #
  542.     find • "{OldLoc}.r"                                    # go to beginning of file
  543.     find • "{OldUS}.r"                                    #
  544. End                                                                        #
  545. find • "{NewUS}.r"                                        #
  546. #
  547. #
  548. Loop                                                                    #
  549.     find /∂'WIND∂'/ "{NewUS}.r"                    # find the next WIND resource
  550.     break if {status} == {Failure}            #
  551.     find {id.num} "{NewUS}.r"                        # find its id number
  552.     set Number `catenate "{NewUS}.r".§`    # Save the resource number for use later
  553.                                                                             #
  554.     find /∂'WIND∂' ∂({Number}[,)]+/ "{OldLoc}.r"
  555.                                                                             #
  556.     find /∂'WIND∂' ∂({Number}[,)]+/ "{OldUS}.r"
  557.     if {status} == {Success}                        # if I found it
  558.         find {box} "{NewUS}.r"                        #
  559.         find {box} "{OldUS}.r"                        #
  560.                                                                             #
  561.         compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  562.         if {status} == {Success}                    #
  563.             copy {box} "{OldLoc}.r"                 # cut and paste box size
  564.             paste § "{NewUS}.r"                            #
  565.         else                                                             #
  566. #            find {box} "{OldLoc}.r"                 #
  567.                                                                             # Log the change!
  568.             echo "***    New location/size — ∂'WIND∂' {Number}" >> "{Log}"
  569.         end                                                                #
  570.         find /∂"/:/∂"/ "{OldUS}.r"                    # ddm 2/1/90 changed {string} to /∂"/:/∂"/
  571.         find /∂"/:/∂"/ "{NewUS}.r"                    # ddm 2/1/90 changed {string} to /∂"/:/∂"/
  572.                                                                             #
  573.          compare "{OldUS}.r".§ "{NewUS}.r".§ >"{boot}Junk"
  574.         if {status} == {Success}                    #
  575.                                                                             # ddm 2/1/90 changed {string} to /∂"/:/∂"/
  576.             find /∂"/:/∂"/ "{OldLoc}.r"             # copy and paste text info
  577.                                                                             #
  578.             catenate "{OldLoc}.r".§ > "{NewUS}.r".§
  579.         else                                                            #
  580.                                                                             # Log the change!
  581.             echo "***    New window name — ∂'WIND∂' {Number}" >> "{Log}"
  582.         end                                                                #
  583.     else                                                                 # else (new WIND!)
  584.                                                                             # Log the new resource!
  585.         echo "***    New resource — ∂'WIND∂' {Number}" >> "{Log}"
  586.     end                                                                    #
  587.     find • "{OldLoc}.r"                                    # go to beginning of file
  588.     find • "{OldUS}.r"                                    #
  589. End                                                                        #
  590. find • "{NewUS}.r"                                        #
  591. #
  592. #
  593. close "{OldLoc}.r"                                        #
  594. close "{OldUS}.r"                                            #
  595.                                                                             # logout
  596. echo  RunLoop -- ending `date` >> "{Log}"
  597.